package com.sky.validation.dto;

import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class SchoolDto {

    @NotNull(message = "学校编号不能为空")
    @Pattern(regexp = "^[0-9]*$", message = "学校编号必须为数字")
    private String id;

    @NotNull(message = "学校名称不能为空")
    private String name;

    @NotNull(message = "学校地址不允许为空")
    @Size(max = 255, min = 1, message = "学校地址长度不能超过255")
    private String addr;

    @Valid
    private UserDto user;
}
